<#assign base=request.contextPath />
<#assign oneLabel="ERP管理">

<#assign twoLabel="客户管理">
<#assign twoUrl=base+"/customer/list">

<#if customerDO?? && (customerDO.id)!=0>
	<#assign leafLabel="编辑客户">
	<#else>
	<#assign leafLabel="新增客户">
</#if>
<!DOCTYPE html>
<html lang="en">
<head>
	<link rel="stylesheet" href="${base}/static/assets/css/chosen.css" />
	<#include "/commons/headImport.ftl">
</head>
<body>
<#include "/commons/header.ftl">
<form class="form-horizontal" name="formName" method="post">
<#include "/commons/hiddenField.ftl">
<@spring.formHiddenInput "customerDO.id"/>
<div class="row">
	<div class="col-xs-12">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				姓名<span class="red">*</span>
			</label>
			<div class="col-sm-4">
				<@spring.formInput "customerDO.fullName" "AUTOCOMPLETE='off' class='col-xs-10 col-sm-8'"/>
			</div>
			<div class="help-block col-xs-12 col-sm-reset inline red">
				<@spring.showErrors "customerDO.fullName" />
                <#if error??>
                	<#assign err=error?keys>
                    <#list err as k>
                        ${error['${k}']}
                    </#list>
                </#if>
			</div>
		</div>
		<div class="space-4"></div>
							
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				联系电话<span class="red">*</span>
			</label>
			<div class="col-sm-4">
				<@spring.formInput "customerDO.tel" "AUTOCOMPLETE='off' class='col-xs-10 col-sm-8'"/>
			</div>
			<div class="help-block col-xs-12 col-sm-reset inline red">
				<@spring.showErrors "customerDO.tel" />
			</div>
		</div>
		<div class="space-4"></div>
	
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				公司名称<span class="red">*</span>
			</label>
			<div class="col-sm-4">
				<@spring.formInput "customerDO.companyName" "AUTOCOMPLETE='off' class='col-xs-10 col-sm-8'"/>
			</div>
			<div class="help-block col-xs-12 col-sm-reset inline red">
				<@spring.showErrors "customerDO.companyName" />
			</div>
		</div>
		<div class="space-4"></div>

		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				公司地址
			</label>
			<div class="col-sm-4">
				<@spring.formInput "customerDO.companyAddress" "AUTOCOMPLETE='off' class='col-xs-10 col-sm-8'"/>
			</div>
			<div class="help-block col-xs-12 col-sm-reset inline red">
				<@spring.showErrors "customerDO.companyAddress" />
			</div>
		</div>
		<div class="space-4"></div>

		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				状态<span class="red">*</span>
			</label>
			<div class="col-sm-4">
				<@spring.formSingleSelect "customerDO.status" statusMap 'class="col-sm-6 chosen-select"'/>
			</div>
			<div class="help-block col-xs-12 col-sm-reset inline red">
				<@spring.showErrors "customerDO.status" />
			</div>
		</div>
		<div class="space-4"></div>
							
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right">
				备注
			</label>
			<div class="col-sm-4">
				<@spring.formTextarea "customerDO.remark" "class='col-xs-10 col-sm-8'"/>
			</div>
			<div class="help-block col-xs-12 col-sm-reset inline red">
				<@spring.showErrors "customerDO.remark" />
			</div>
		</div>
		<div class="space-4"></div>
	</div><!-- /.col -->
</div><!-- /.row -->
</form>

<div class="hr hr32 hr-dotted"></div>
<div class="clearfix">
	<div class="col-md-offset-2 col-md-9">
		<button class="btn btn-xs btn-info" type="button" id="save_id" 
			url="<#if customerDO??&&customerDO.id!=0>${base}/customer/edit<#else>${base}/customer/add</#if>">
			<i class="icon-save bigger-110"></i>保存
		</button>
		<button class="btn btn-xs return_class" type="button" url="${base}/customer/list">
			<i class="icon-reply bigger-110"></i>返回
		</button>
	</div>
</div>
<#include "/commons/footer.ftl">
<script src="${base}/static/assets/js/chosen.jquery.min.js"></script>
<script>
jQuery(function($) {
	$(".chosen-select").chosen();
});
</script>
</body>
</html>
